package com.ieei.iService;

import java.util.Map;

import javax.jws.WebParam;
import javax.jws.WebService;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import com.ieei.server.IntegerUserMapAdapter;
import com.ieei.server.User;

@WebService
public interface HelloWorld {
	/**
	 * WebParam注解是必须的，因为java接口编译后的.class文件不保存参数的名字，所以如果没有加注解，参数将被命名为arg0
	 * 
	 * @param text
	 * @return
	 */
	String sayHi(@WebParam(name = "text") String text);

	/*
	 * Advanced usecase of passing an Interface in. JAX-WS/JAXB does not support
	 * interfaces directly. Special XmlAdapter classes need to be written to
	 * handle them 由于不是基本数据类型,所以必须自定义
	 */
	String sayHiToUser(User user);

	/*
	 * Map passing JAXB also does not support Maps. It handles Lists great, but
	 * Maps are not supported directly. They also require use of a XmlAdapter to
	 * map the maps into beans that JAXB can use.
	 */
	@XmlJavaTypeAdapter(IntegerUserMapAdapter.class)
	Map<Integer, User> getUsers();
}
